package com.mezz.bones.framework.web.handler.log;


import com.mezz.bones.framework.web.domain.RequestLog;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import javax.annotation.Resource;

/**
 * @author mezz
 * @date 2022-12-12 10:50
 * @description:
 */
public abstract class AbstractRequestLogStoreHandler implements RequestLogStoreHandler{

  @Resource(name = "threadPoolTaskExecutor")
  private ThreadPoolTaskExecutor threadPoolTaskExecutor;

  /**
   * 处理请求日志
   */
  @Override
  public void processLog(RequestLog requestLog){
    saveLog(requestLog);
    notify(requestLog);
  }

  /**
   * 持久化日志
   */
  protected abstract void saveLog(RequestLog requestLog);

  private void notify(RequestLog requestLog) {

  }


}
